// @ts-ignore
/* eslint-disable */
import { AssetParams, AssetResult, AssetResultItem } from '@/services/api/model/assetModel';
import { request } from '@umijs/max';
export async function getList(params: AssetParams) {
  return request<AssetResult>(API_URL + '/superlink/api/assets', {
    method: 'GET',
    params,
  });
}

export async function delItem(id: string) {
  return request(API_URL + '/superlink/api/assets/delete/' + id, {
    method: 'DELETE',
  });
}

export async function createItem(data: AssetResultItem) {
  return request(API_URL + '/superlink/api/assets/create', {
    method: 'POST',
    data,
  });
}
export async function updateItem(data: AssetResultItem) {
  return request(API_URL + '/superlink/api/assets/update/' + data.token, {
    method: 'PUT',
    data,
  });
}

export async function getItemDetails(
  params: { includeAsset?: boolean; token: string },
  options?: { [key: string]: any },
) {
  return request<AssetResultItem>(API_URL + '/superlink/api/assets/' + params.token, {
    method: 'GET',
    params,
    ...(options || {}),
  });
}
